var express = require('express');
const { login, whoami, update } = require('../controller/admin');
const { visCaptcha } = require('../middleware/captcha');
const { refreshToken } = require('../middleware/auth');
var router = express.Router();

// 登录
router.post('/login', visCaptcha, login);

// 更新管理员自己信息
router.put('/', update);

// 获取用户信息
router.get('/whoami', whoami);

// 刷新token
router.post('/refresh-token', refreshToken);

module.exports = router;
